.text
.globl Switch
Switch:
#ifdef __i386__
/*
    0x00     -->      0xff
    eip esp ebp edi esi ebx
    0   4   8   12  16  20     
*/
    #error "not tested yet"
    movl 8(%esp), %eax
    movl 4(%esp), %ebx
    movl (%esp), %edx
    leal 4(%esp), %ecx
    movl %ebp, 8(%ebx)
    movl %ecx, 4(%ebx)
    movl %edx, (%ebx)
    movl %edi, 12(%ebx)
    movl 8(%esp), %ecx
    movl %esi, 16(%ebx)
    movl %ebx, 20(%ebx)
    movl 4(%ecx), %edx
    movl 8(%ecx), %ebp
    movl (%ecx), %ebx
    movl 12(%ecx), %edi
    movl 16(%ecx), %esi
    movl 20(%ecx), %ebx
    xorl %ecx, %ecx
    movl %edx, %esp
    xorl %edx, %edx
    jmpl *%ebx
#else
    #error "platform not support"
#endif
